package com.saozhu.command;

import com.saozhu.pojo.Player;

public abstract class CommandFactory {

	public static enum CommandCode {
		ADDGOODS,ALTERGOODS,DELETEGOODS,DELETEORDER,EXIT,HELP,HELPS,LOGIN,SIGNUP,
		
		EXITS,NEW,SHOW,PAY
	}

	public static CommandFactory buildFactory(Player player) {
		if (player == null) {
			return new SystemCommandFactory();
		} else if ("N".equalsIgnoreCase(player.getManage())) {
			return new CustomerCommandFactory(player);
		}
		return new ManagerCommandFactory(player);
	}

	public abstract Command buildCommand(CommandCode commandcode);
}
